package com.zoweunion.mechanic.im;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zoweunion.mechanic.controller.BaseController;
import com.zoweunion.mechanic.model.ResponseBean;
import com.zoweunion.mechanic.model.User;
import com.zoweunion.mechanic.util.constants.Constants;
import com.zoweunion.mechanic.util.MyException;

@RestController
@RequestMapping("/im")
public class ImController extends BaseController{
	@Autowired
	private ImService imService;
	@PostMapping("/getToken")
	public ResponseBean getToken(HttpServletRequest request) throws MyException {
		
		User user = getCurrentUser(request);
		Map<String, Object> map = imService.getToken(user);
		return new ResponseBean(Constants.CODE_SUCCESS,"操作成功",map);
		
	}
}
